home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-10 | 7.3 KB | 329 lines | [TEXT/MPS ] |
- (*
- File: Types.mod
-
- Contains: Basic Macintosh data types.
-
- Version: Technology: System 7.5
- Package: Universal Interfaces 2.0 in “MPW Latest” on ETO #17
-
- Copyright: © 1984-1995 by Apple Computer, Inc.
- All rights reserved.
-
- Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- stack. Include the file and version information (from above)
- in the problem description and send to:
- Internet: apple.bugs.applelink.apple.com
- AppleLink: APPLE.BUGS
-
- *)
-
- (*$TAGS-*)
- (*$CALLING PASCAL*)
- MODULE Types;
-
- IMPORT SYSTEM;
- (*ΔΔ (* $IFC UNDEFINED __CONDITIONALMACROS__*)
- (* $I ConditionalMacros.p*)
- (* $ENDC*)
-
- (* $PUSH*)
- (* $ALIGN MAC68K*)
- (* $LibExport+*)*)
-
- CONST
- noErr* = 0;
-
-
- TYPE
- Byte* = SYSTEM.BYTE (*ΔΔ 0..255*);
-
- SignedByte* = SHORTINT (*ΔΔ -128..127*);
-
- UInt8* = Byte;
-
- SInt8* = SignedByte;
-
- UInt16* = INTEGER;
-
- SInt16* = INTEGER;
-
- UInt32* = LONGINT;
-
- SInt32* = LONGINT;
-
- UniChar* = UInt16;
-
- ByteParameter* = SignedByte;
-
- Data* = RECORD END;
- Ptr* = POINTER TO Data(*ΔΔ SignedByte*);
-
- (* pointer to a master pointer *)
- Handle* = HANDLE TO Data (*ΔΔ POINTER TO Ptr*);
-
- (*ΔΔ $IFC UNDEFINED qMacApp *)
- (*$IF FALSE AND UNDEFINED qMacApp *)
- IntegerPtr* = POINTER TO INTEGER;
-
- LongIntPtr* = POINTER TO LONGINT;
-
- (*$END*)
- Fixed* = LONGINT;
-
- (*ΔΔ FixedPtr* = POINTER TO Fixed;*)
-
- Fract* = LONGINT;
-
- (*ΔΔ FractPtr* = POINTER TO Fract;*)
-
- _extended80* = RECORD
- exp*: INTEGER;
- man*: ARRAY 4 (*ΔΔ[0..3]ΔΔ*) OF INTEGER;
- END;
-
- _extended96* = RECORD
- exp*: ARRAY 2 (*ΔΔ[0..1]ΔΔ*) OF INTEGER;
- man*: ARRAY 4 (*ΔΔ[0..3]ΔΔ*) OF INTEGER;
- END;
-
- (*$IF GENERATING68K *)
- (*
- Note: on PowerPC extended is undefined.
- on 68K when mc68881 is on, extended is 96 bits.
- when mc68881 is off, extended is 80 bits.
- Some old toolbox routines require an 80 bit extended so we define extended80
- *)
- (*$IF GENERATING68881 *)
- Extended80* = _extended80;
-
- Extended96* = Extended;
-
- (*$ELSE*)
- Extended80* = LONGREAL (*ΔΔ Extended*);
-
- Extended96* = _extended96;
-
- (*$END*)
- (*$ELSE*)
- Extended80* = _extended80;
-
- Extended96* = _extended96;
-
- (*$END*)
- (*
- Note: float_t and double_t are "natural" computational types
- (i.e.the compiler/processor can most easily do floating point
- operations with that type.)
- *)
- (*$IF GENERATINGPOWERPC *)
- (* on PowerPC, double* = 64-bit which is fastest. float* = 32-bit *)
- float_t* = Single;
-
- double_t* = Double;
-
- (*$IF LSPWRP *)
- LongDouble* = RECORD
- head*: Double;
- tail*: Double;
- END;
-
- (*$END*)
- (*$ELSE*)
- (* on 68K, long double (a.k.a. extended) is always the fastest. It is 80 or 96-bits *)
- float_t* = LONGREAL (*ΔΔ extended*);
-
- double_t* = LONGREAL (*ΔΔ extended*);
-
- (*$END*)
- wide* = RECORD
- hi*: SInt32;
- lo*: UInt32;
- END;
-
- WidePtr* = POINTER TO wide;
-
- UnsignedWide* = RECORD
- hi*: UInt32;
- lo*: UInt32;
- END;
-
- UnsignedWidePtr* = POINTER TO UnsignedWide;
-
-
- CONST
- v* = 0;
- h* = 1;
-
-
- TYPE
- VHSelect* = SInt8;
-
- ProcPtr* = PROCEDURE (*ΔΔ Ptr*);
-
- Register68kProcPtr* = PROCEDURE (*ΔΔ ProcPtr*);
-
- ProcHandle* = SYSTEM.HANDLE (*ΔΔ POINTER TO ProcPtr*);
-
- UniversalProcPtr* = ProcPtr;
- UniversalProcHandle* = SYSTEM.HANDLE (*ΔΔ POINTER TO ProcPtr*);
-
- Str255* = ARRAY 256 OF CHAR (*ΔΔ STRING[255]*);
- Str63* = ARRAY 64 OF CHAR (*ΔΔ STRING[63]*);
- Str32* = ARRAY 33 OF CHAR (*ΔΔ STRING[32]*);
- Str31* = ARRAY 32 OF CHAR (*ΔΔ STRING[31]*);
- Str27* = ARRAY 28 OF CHAR (*ΔΔ STRING[27]*);
- Str15* = ARRAY 16 OF CHAR (*ΔΔ STRING[15]*);
-
- StringPtr* = POINTER TO Str255;
- StringHandle* = HANDLE TO Str255 (*ΔΔ POINTER TO StringPtr*);
-
- (* A C string is a zero terminated array of bytes. There is no length byte.
- a CStringPtr is a pointer to a C string (e.g. char* )
- a ConstCStringPtr is a CStringPtr whose contents cannot be changed (e.g. const char* )
- *)
- CStringPtr* = Ptr;
- ConstCStringPtr* = Ptr;
-
- ConstStr255Param* = Str255;
-
- ConstStr63Param* = Str63;
-
- ConstStr32Param* = Str32;
-
- ConstStr31Param* = Str31;
-
- ConstStr27Param* = Str27;
-
- ConstStr15Param* = Str15;
-
- OSErr* = INTEGER;
-
- ScriptCode* = INTEGER;
-
- LangCode* = INTEGER;
-
- (*$IF GENERATING68K OR UNDEFINED MWERKS *)
- FourCharCode* = LONGINT (*ΔΔ PACKED ARRAY [1..4] OF CHAR*);
- (*$ELSE*)
- FourCharCode* = UNSIGNEDLONG;
- (*$END*)
- (*ΔΔ StyleItem* = (bold,italic,underline,outline,shadow,condense,extend);*)
- SytleItem* = SHORTINT;
- CONST
- bold* = 1; italic* = 2; underline* = 4; outline* = 8; shadow* = 16; condense* = 32; extend* = 64;
- TYPE
- Style* = SHORTINT (*ΔΔ SET OF StyleItem*);
-
- OSType* = FourCharCode;
-
- ResType* = FourCharCode;
-
- (*ΔΔ OSTypePtr* = POINTER TO OSType;
-
- ResTypePtr* = POINTER TO ResType;*)
-
- Point* = RECORD
- (*ΔΔ CASE INTEGER OF
- 0: ( *)
- v*: INTEGER;
- h*: INTEGER;
- (*ΔΔ);
- 1: (
- vh*: ARRAY [0..1] OF INTEGER;
- );*)
- END;
-
- PointPtr* = POINTER TO Point;
-
- Rect* = RECORD
- (*ΔΔ CASE INTEGER OF
- 0: ( *)
- top*: INTEGER;
- left*: INTEGER;
- bottom*: INTEGER;
- right*: INTEGER;
- (*);
- 1: (
- topLeft*: Point;
- botRight*: Point;
- );*)
- END;
-
- RectPtr* = POINTER TO Rect;
-
- (* Numeric version part of LONG("vers") resource *)
- NumVersion* = (*ΔΔ PACKED*) RECORD
- majorRev*: UInt8; (*1st part of version number in BCD*)
- minorAndBugRev*: UInt8; (*2nd & 3rd part of version number share a byte*)
- stage*: UInt8; (*stage code: dev, alpha, beta, final*)
- nonRelRev*: UInt8; (*revision level of non-released version*)
- END;
-
- (* LONG("vers") resource format *)
- VersRec* = RECORD
- numericVersion*: NumVersion; (*encoded version number*)
- countryCode*: INTEGER; (*country code from intl utilities*)
- shortVersion*: Str255; (*version number string - worst case*)
- reserved*: Str255; (*longMessage string packed after shortVersion*)
- END;
-
- VersRecPtr* = POINTER TO VersRec;
- VersRecHndl* = HANDLE TO VersRec (*ΔΔ POINTER TO VersRecPtr*);
-
- KernelID* = Ptr;
-
- OSStatus* = SInt32;
-
- LogicalAddress* = Ptr;
-
- (*
- Who implements what debugger functions:
-
- Name MacsBug SADE Macintosh Debugger
- ---------- ----------- ------- -----------------------------
- Debugger yes no InterfaceLib maps to DebugStr
- DebugStr yes no yes
- Debugger68k yes no InterfaceLib maps to DebugStr
- DebugStr68k yes no InterfaceLib maps to DebugStr
- debugstr yes no InterfaceLib maps to DebugStr
- SysBreak no, for SADE yes InterfaceLib maps to SysError
- SysBreakStr no, for SADE yes InterfaceLib maps to SysError
- SysBreakFunc no, for SADE yes InterfaceLib maps to SysError
-
- *)
-
- PROCEDURE Debugger*;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $A9FF;
- (*$END*)
- PROCEDURE DebugStr*(debuggerMsg: ConstStr255Param);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $ABFF;
- (*$END*)
- PROCEDURE Debugger68k*;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $A9FF;
- (*$END*)
- PROCEDURE DebugStr68k*(debuggerMsg: ConstStr255Param);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $ABFF;
- (*$END*)
- PROCEDURE SysBreak*;
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, $FE16, $A9C9;
- (*$END*)
- PROCEDURE SysBreakStr*(debuggerMsg: ConstStr255Param);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, $FE15, $A9C9;
- (*$END*)
- PROCEDURE SysBreakFunc*(debuggerMsg: ConstStr255Param);
- (*$IF NOT GENERATINGCFM*)
- INLINE PASCAL $303C, $FE14, $A9C9;
- (*$END*)
-
- (*ΔΔ (* $ALIGN RESET*)
- (* $POP*)
-
- (* $SETC UsingIncludes := TypesIncludes*)*)
-
- END Types.